package com.atguigu.service.impl;

import com.atguigu.mapper.AdminRoleMapper;
import com.atguigu.service.AdminRoleService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @Author:hx
 * @DateTime:2022/10/1 10:18
 * @Description:
 */
@DubboService
public class AdminRoleServiceImpl implements AdminRoleService {
    @Autowired
    private AdminRoleMapper adminRoleMapper;

    @Override
    public void assignRole(Long adminId, List<Long> roleIds) {
        //先根据用户id进行删除
        adminRoleMapper.delete(adminId);
        //重新分配角色
        adminRoleMapper.insert(adminId,roleIds);
    }
}
